/* Masonry layout for the gallery */
.filter-container {
    column-count: 4;       /* number of columns */
    column-gap: 20px;      /* gap between columns */
    width: 100%;
}

/* Each gallery item */
.filter {
    display: inline-block; /* required for column layout */
    width: 100%;           /* fill the column */
    margin-bottom: 20px;
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 0.5s cubic-bezier(0.4,0,0.2,1),
                transform 0.5s cubic-bezier(0.4,0,0.2,1);
    transform-origin: top center;
    break-inside: avoid;   /* prevents splitting across columns */
    position: relative;
}
.filter-hidden {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    pointer-events: none;
}

/* Filter buttons */
.filter-buttons {
    margin-bottom: 20px;
    text-align: center;
}
.filter-button {
    display: inline-block;
    margin: 0 4px 8px 4px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f0f0f0;
    color: #333;
    cursor: pointer;
    font-size: 1.8rem;
    transition: all 0.3s ease;
    user-select: none;
}
.filter-button:hover,
.filter-button.active {
    background-color: #007BFF;
    color: #fff;
    border-color: #007BFF;
}

/* Fancybox navigation arrows */
.fancybox-button--arrow_left,
.fancybox-button--arrow_right {
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
}
.fancybox-button--arrow_left::before,
.fancybox-button--arrow_right::before {
    font-size: 30px;
    color: white;
}

/* Scrollable content for tall images */
.fancybox-content {
    max-height: 95vh;
    overflow-y: auto;
}

/* Images */
.filter img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* Post content */
.post-content {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    background-color: rgba(255,255,255,0.7);
    padding-top: 3px;
    padding-bottom: 3px;
    transition: all 0.8s ease;
    -webkit-transition: all 0.8s ease;
    -moz-transition: all 0.8s ease;
    -ms-transition: all 0.8s ease;
    -o-transition: all 0.8s ease;
}
.post-content h4 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}
.masonry-hover-wrap {
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}
.masonry-hover-wrap .post-content-hover {
    position: absolute;
    text-align: center;
    margin: 0 auto;
    background: linear-gradient(to bottom,rgba(0,0,0,0.7) 0%,rgba(17,30,87,0.8) 100%);
    opacity: 0;
    height: 100%;
    width: 100%;
    transition: all 0.8s ease;
    border-radius: 4px;
    -webkit-transition: all 0.8s ease;
    -moz-transition: all 0.8s ease;
    -ms-transition: all 0.8s ease;
    -o-transition: all 0.8s ease;
}
.masonry-hover-wrap:hover .post-content-hover {
    background: linear-gradient(to bottom,rgba(0,0,0,0.7) 0%,rgba(17,30,87,0.8) 100%);
    height: 100%;
    border-radius: 4px;
}
.masonry-hover-wrap:hover .post-content {
    opacity: 0;
}
.masonry-hover-wrap:hover .post-content-hover {
    opacity: 1;
    transition: all 1s ease;
}
.masonry-hover-wrap:hover .post-content-hover h4 {
    color: #fff;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}
/* Responsive columns */
@media (max-width: 1100px) {
    .filter-container { column-count: 3; }
}

@media (max-width: 760px)  {
    .filter-container { column-count: 2; }
}

@media (max-width: 480px)  {
    .filter-container { column-count: 1; }
}
